package com.guojian.common.view;

public class ResultView<T> {
	private boolean status;

	private T data;

	private String msg;

	public ResultView(boolean status, T data) {
		this.status = status;
		this.data = data;
		this.msg = status ? "操作成功!" : "操作失败!";
	}

	public ResultView(boolean status, T data, String msg) {
		this.status = status;
		this.data = data;
		this.msg = msg;
	}

	public boolean isStatus() {
		return status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public static <T> ResultView<T> build(boolean status, T data) {
		return new ResultView<T>(status, data);
	}

	public static <T> ResultView<T> build(boolean status, T data, String msg) {
		return new ResultView<T>(status, data, msg);
	}

}
